<?php
session_start();
if (empty($_SESSION['username'])) {
    echo '<script type="text/javascript">window.location.href="../index.php";</script>';
} else {
    $now = time();
    if ($now > $_SESSION['expire']) {
        session_destroy();
        echo '<script type="text/javascript">var r=confirm("Session expire (30 mins)!"); if(r==true){window.location.href="../index.php";}else{window.location.href="index.php";}</script>';
    } else {
        require '../model-db-connection/config.php';
        $config = require '../model-db-connection/qrc_conf.properties.php';
    }
}
?>
<table width="95%">
    <tr>
        <td align="right" style="width:250px">Project Name (ชื่อโครงการ):</td>
        <td align="left" style="width:250px">
            <!--<input type="text" class="form-control" id="team_code_search">-->
            <select class="form-control" id="po_project_name_search" name="po_project_name_search">
                <option value="0"></option>
                <?php
                $sqlSelectMemType = "SELECT * FROM QRC_PROJECT;";
                $resultSets = mysql_query($sqlSelectMemType);
                while ($row = mysql_fetch_array($resultSets)) {
                    echo '<option value="' . $row['project_code'] . '">' . $row['project_name'] . '</option>';
                }
                ?>
            </select>
        </td>
        <td align="right" style="width:250px">Project Code (หมายเลขโครงการ):</td>
        <td align="left" style="width:250px"><input type="text" class="form-control" id="po_project_code_search"></td>
    </tr>
    <tr>
        <td align="right" style="width:250px">Document No. (เลขที่):</td>
        <td align="left" style="width:250px">
            <input type="text" class="form-control" id="po_document_no_search">
        </td>
        <td align="right" style="width:250px">PO No. (เลขที่ใบสั่งจ้าง):</td>
        <td align="left" style="width:250px"><input type="text" class="form-control" id="po_po_no_search"></td>
    </tr>
    <tr>
        <td align="right" style="width:250px">PO Owner (เจ้าของ PO):</td>
        <td align="left" style="width:250px">
            <input type="text" class="form-control" id="po_owner_search">
        </td>
        <td align="right" style="width:250px">PO Sender (จนท. PO):</td>
        <td align="left" style="width:250px"><input type="text" class="form-control" id="po_sender_search"></td>
    </tr>
    <tr>
        <td align="right" style="width:250px">Issue Date (วันที่):</td>
        <td align="left" style="width:250px"><input type="text" class="form-control date_selecter search_date" id="po_issue_date_search" data-date-format="yyyy-mm-dd"></td>
        <td align="right" style="width:250px">Order Type (ประเภทงาน):</td>
        <td align="left" style="width:250px">
            <select class="form-control" id="po_order_type_search" name="po_order_type_search">
                <option value="0"></option>
                <?php
                $sqlSelectMemType = "SELECT * FROM QRC_TYPE_OF_SERVICE;";
                $resultSets = mysql_query($sqlSelectMemType);
                while ($row = mysql_fetch_array($resultSets)) {
                    echo '<option value="' . $row['service_id'] . '">' . $row['service_name'] . '</option>';
                }
                ?>
            </select>
        </td>
    </tr>
</table>
<script type="text/javascript" src="../js/bootstrap-datepicker.js"></script>
<link rel="stylesheet" type="text/css" href="../css/datepicker.css" media="screen" />
<script type="text/javascript">
    $(document).ready(function() {
        $(".search_date").datepicker();
    });
</script>
